def count_prefixes(words: list, goal:str):
    count = 0
    for word in words:
        if goal.startswith(word):
            count += 1

    return count

n = count_prefixes(['a', 'b', 'abc', 'abcd'], 'abcd')
print(n)